<?php

namespace app\admin\controller\data;

use app\admin\model\UM as UM;
use app\admin\service\MemberStatisticsService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * MemberStatistics 控制器
 * Class MemberStatistics
 * @package app\admin\controller\data;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class MemberStatistics
{
    // 请求参数
    private Request $request;

    // service
    private MemberStatisticsService $service;

    public function __construct(Request $request, MemberStatisticsService $memberStatisticsService)
    {
        $this->request = $request;
        $this->service = $memberStatisticsService;
    }

    /**
     * 数据-用户统计
     * @return ApiResponse
     * @url /data/member_statistics/read
     */
    public function read( ): ApiResponse
    {
        $request = $this->request;

        return ApiResponse::success($this->service->readOfData($request->param()));
    }
}
